package com.wedata.中台服务;

import cn.hutool.crypto.digest.MD5;
import cn.hutool.json.JSONObject;
import com.wedata.HttpUtils;

public class MessageSms {

    public static void main(String[] args) {
        String uri = "https://wedata.gymcity.com.cn/message/qiwei/uploadImageMedia";
        JSONObject body = new JSONObject("{\"fileUrl\":\"https://cdnvue.gymcity.com.cn/shop_3.0/5cc80e58b0c81.jpg\",\"corpid\":\"wwbb3eaebf35674eef\",\"agentId\":\"1000005\"}");


        String sign = MD5.create().digestHex(body+"#270ad09cbecc217ffe120a8550f61c12");
        JSONObject header = new JSONObject("{\"X-TRACEID\":\"uuid\",\"X-APPKEY\":\"12700048053\",\"X-SIGN\":\""+sign+"\"}");




        Long s = System.currentTimeMillis();
        System.out.println(HttpUtils.sendPost(uri,header,body)+":"+(System.currentTimeMillis()-s));


    }

    public static void 查询推送消息(String[] args) {
        String uri = "https://wedata.gymcity.com.cn/message/tpns/getPushTaskStatChannel";
        JSONObject body = new JSONObject("{\"route\":\"btw-android\",\"pushId\":928539262}");


        String sign = MD5.create().digestHex(body+"#270ad09cbecc217ffe120a8550f61c12");
        JSONObject header = new JSONObject("{\"X-TRACEID\":\"uuid\",\"X-APPKEY\":\"12700048053\",\"X-SIGN\":\""+sign+"\"}");




        Long s = System.currentTimeMillis();
        System.out.println(HttpUtils.sendPost(uri,header,body)+":"+(System.currentTimeMillis()-s));


    }


}
